package com.jf.springboot.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.method.HandlerMethod;

import java.lang.invoke.MethodHandle;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-12-06
 * Time:14:28
 */
@Slf4j
@ControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    public String handleException(Exception e/*, HandlerMethod handler*/) {
        log.error(e.getMessage(), e);
        //log.error(handler.getBean().getClass().getName());
        return "/error/global.html";
    }
}
